#region

using FluentlyDo.Entities;
using FluentNHibernate.Mapping;

#endregion

namespace FluentlyDo.Mapping
{
    public class NutMap : ClassMap<Nut>
    {
        public NutMap()
        {
            Id(x => x.Id).GeneratedBy.Foreign("Property on this entity, whos id this entity should use")
                .GeneratedBy
                .Identity();

            HasOne(x => x.Bolt)
                .ForeignKey("FK_Bolt_to_Map")
                .Cascade.All();

        }
    }

    public class BoltMap : ClassMap<Bolt>
    {
        public BoltMap()
        {
            Id(x => x.Id)
                .GeneratedBy
                .Identity();

            HasOne(x => x.Nut)
               .ForeignKey("FK_Bolt_to_Map")
               .Cascade.All();

        }
    }
}